package com.cooldatasoft.util;

import org.apache.wicket.ResourceReference;
import org.apache.wicket.behavior.HeaderContributor;
import org.apache.wicket.markup.html.IHeaderContributor;
import org.apache.wicket.markup.html.IHeaderResponse;

public class WicketUtils {

	public static HeaderContributor headerContributorForFavicon(
			final ResourceReference reference) {
		return new HeaderContributor(new IHeaderContributor() {
			private static final long serialVersionUID = 1L;

			public void renderHead(final IHeaderResponse response) {
				StringBuilder buffer = new StringBuilder()
						.append("<link type=\"image/x-icon\" rel=\"shortcut icon\" href=\"resources/favicon.ico\" />");
				response.renderString(buffer.toString());
			}
		});
	}
}
